package net.ojbk.fileboss.web.handlers.impl;

import net.ojbk.fileboss.service.ITestService;
import net.ojbk.fileboss.web.handlers.ITestController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * Created with IntelliJ IDEA.
 * User: twobox
 * Date: 2019/3/20
 * Time: 22:10
 * Description: No Description
 */
@Controller
@RequestMapping("/test")
public class TestControllerImpl implements ITestController {
    @Autowired
    private ITestService testService;

    /**
     * You can get all test data through URL.
     *
     * @return json of test data
     */
    @Override
    @RequestMapping(value = "dataList", method = RequestMethod.GET)
    public ResponseEntity<Object> getAllTestData() {
        return new ResponseEntity<Object>(testService.getAll(), HttpStatus.OK);
    }
}
